package com.android.yummycookies.storage.factory;

import com.android.yummycookies.BuildConfig;
import com.android.yummycookies.storage.BitmapStorage;
import com.android.yummycookies.util.Logger;

/**
 * Fabrique de BitmapStorage
 * 
 * @author julien
 * 
 */
public class BitmapStorageFactory implements
		IBitmapStorageFactory<BitmapStorage> {
	
	public static final String TAG = BitmapStorageFactory.class.getSimpleName();

	/** Holder */
	private static class SingletonHolder {
		/** Instance unique non preinitialise */
		private final static BitmapStorage instance = new BitmapStorage();
	}

	/**
	 * Retourne une instance unique de BitmapStorage
	 */
	@Override
	public BitmapStorage getBitmapStorage() {
		if(BuildConfig.DEBUG){
			Logger.logDebug(TAG, "Return unique instance of BitmapStorage");
		}
		return SingletonHolder.instance;
	}

}
